# Contributor: Celeste <cielesti@protonmail.com>
# Maintainer: Celeste <cielesti@protonmail.com>
pkgname=emacs-pyim-cangjiedict
pkgver=0_git20210617
_gitrev=d17e3d32a6480939b350a91a915ebe8e6efad819
pkgrel=0
_pkgreal=pyim-cangjiedict
pkgdesc="Cangjie dicts for Emacs-pyim"
url="https://github.com/con5tella/pyim-cangjiedict"
arch="noarch"
license="GPL-3.0-or-later"
depends="cmd:emacs"
makedepends="emacs-nox emacs-pyim"
source="https://github.com/con5tella/pyim-cangjiedict/archive/$_gitrev/emacs-pyim-cangjiedict-$_gitrev.tar.gz"
builddir="$srcdir/$_pkgreal-$_gitrev"
options="!check" # no tests provided

build() {
	emacs -batch -q -no-site-file -L . \
		-eval '(setq byte-compile-error-on-warn t)' \
		-f batch-byte-compile \
		./*.el
}

package() {
	install -Dvm644 ./*.el ./*.elc ./*.pyim \
		-t "$pkgdir"/usr/share/emacs/site-lisp/pyim/

	cd "$pkgdir"/usr/share/emacs/site-lisp/pyim
	emacs -batch -q -no-site-file \
		-eval "(loaddefs-generate \".\" \"$_pkgreal-loaddefs.el\")"
}

sha512sums="
eed4416458f82f93ac8388046a4634bb719deafbe4a23cbe3f5e5c16546d62b3892a3cda6b0deca16889c403b4088dc196ba19e6cf60138315285fa01e5fe78d  emacs-pyim-cangjiedict-d17e3d32a6480939b350a91a915ebe8e6efad819.tar.gz
"
